<?php
/**
  * wechat php test
  */
require_once './config.php';

require DZ_ROOT . 'class_core.php';
$discuz = C::app();
#Pass xss check
if($_SERVER['REQUEST_METHOD'] !== 'GET') {
	$_GET['formhash'] = formhash();
}
$discuz->init();

require_once './class/Discuz/DiscuzUserDAO.php';

ini_set("log_errors", 1);

$userDAO = new DiscuzUserDAO();

$record = $userDAO->getDZUser('o2A4Aj5g2dOnI9wwY-lMYd0GULnY');
if(is_null($record)) {
    $userDAO->createDZUser(
    		array("openid" => 'o2A4Aj5g2dOnI9wwY-lMYd0GULnY',
                   "nickname" => '小黄鸭',
                   "gender" => 1,
                   "city" => '上海',
                   "headimgurl" => 'http://wx.qlogo.cn/mmopen/CW6wibs2go5E5BaVbI72J0bM0AcWmhn4CJ3d4yfG9Q3tNPUibfh4icIWBcd4To2c3MMPBIxpuMXMKPdp72LJtDR3YsHTKLHTKvp/')
    );
}


?>
